package com.ruoyi.project.storage.socket;

import java.io.*;
import java.net.Socket;
import java.net.UnknownHostException;

/**
 * 请添加注释
 *
 * @author mengyuanqing
 * @date 2021/1/24
 */
public class SocketClient {
    public static void main(String[] args) {
        try {
            Socket s = new Socket("192.168.1.212", 8080);
            OutputStream os = s.getOutputStream();
            BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(os));
            //向单片机服务器端发送开启指令
            bw.write("a");
            bw.flush();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
